package Object;

import java.util.Arrays;

public class Practice {
    public static void main(String[] args) {
        String line="qazwsx123edc456rfv";
        String[] data=line.split("[0-9]+");
        System.out.println(Arrays.toString(data));

        line="12.3.456.78";
        data=line.split("\\.");
        System.out.println(Arrays.toString(data));

        line=".1.23.456..78......";
        data=line.split("\\.");
        System.out.println(Arrays.toString(data));
        System.out.println(data.length);


        String num="qweasd123zxc321";
        num=num.replaceAll("[0-9]+","#");
        System.out.println(num);


        String email = "qq123456@tedu.com";
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";
        boolean match = email.matches(regex);
        if (match) {
            System.out.println("yes");
        } else {
            System.out.println("no");
        }













        /*
        String email = "sangsk@tedu.com";
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";
        boolean match = email.matches(regex);
        if (match) {
            System.out.println("yes");
        } else {
            System.out.println("no");
        }

        String line1="abc123de456ghi78";
        line1=line1.replaceAll("[0-9]+","#number#");
        System.out.println(line1);

        String line="abc123def456ghi";
        String[] data=line.split("[0-9]+");
        System.out.println(Arrays.toString(data));

        line="123.456.78";
        data=line.split("\\.");
        System.out.println(Arrays.toString(data));

        line=".123.456..78......";
        data=line.split("\\.");
        System.out.println(Arrays.toString(data));
        System.out.println(data.length);

        */
    }
}